package com.yc.cloud.api.enums;

import lombok.Getter;

/**
 * 告警状态枚举
 */
@Getter
public enum AlarmStatusEnum {
    
    PENDING((byte)0, "待处理"),
    PROCESSING((byte)1, "处理中"),
    CLOSED((byte)2, "已关闭"),
    FALSE_ALARM((byte)3, "误报");
    
    private final byte value;
    private final String desc;
    
    AlarmStatusEnum(byte value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    
    public static AlarmStatusEnum getByValue(Byte value) {
        if (value == null) {
            return null;
        }
        
        for (AlarmStatusEnum status : AlarmStatusEnum.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        
        return null;
    }
}